package cate.game.role.bag.rune;

import cate.common.table.d.GDBag;
import cate.common.table.d.GDObj;
import cate.common.table.item.rune.row.RuneBaseRow;
import cate.game.role.Role;
import cate.game.role.bag.BagContainer;
import cate.game.role.bag.item.msg.ItemAddResp;
import cate.game.role.bag.rune.msg.RuneAddResp;
import com.fasterxml.jackson.annotation.JsonIgnore;
import easy.java.dev.note.NoteClass;

@NoteClass("徽章")
public class RuneBag extends BagContainer<Rune> {
    public RuneBag(){

    }

    public RuneBag(Role role){
        super(role);
    }

    @Override
    protected byte getItemType() {
        return GDObj.Type.RUNE;
    }

    @Override
    public int calcCapacity() {
        return GDBag.Capcity.RUNE;
    }

    @Override
    protected ItemAddResp createItemAddMsg() {
        return new RuneAddResp();
    }

    @Override
    protected Rune createItem(int tid, long num) {
        return new Rune(role, tid, num);
    }

    @Override
    @JsonIgnore
    public RuneBaseRow getItemTpl(int templateId) {
        return role.getGame().table.rune.base.get(templateId);
    }
}
